- has_project_shortcut_buttons = !current_user || current_user.project_shortcut_buttons
- show_auto_devops_callout = show_auto_devops_callout?(@project)
- anchor_buttons = @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout)
- statistics_empty_buttons = @project.empty_repo_statistics_buttons
- statistics_buttons = @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout)

%aside.project-page-sidebar{ data: { testid: 'project-page-sidebar' } }
  .project-page-sidebar-block.home-panel-home-desc.gl-py-4.gl-border-b.gl-border-b-subtle{ class: '!gl-pt-2' }
    %h2.gl-text-base.gl-font-bold.gl-leading-reset.gl-text-heading.gl-m-0.gl-mb-1= s_('ProjectPage|Project information')
    -# Project description
    - if @project.description.present?
      .home-panel-description.gl-break-words
        .home-panel-description-markdown.read-more-container{ itemprop: 'description', data: { 'read-more-height': 320 } }
          .read-more-content.read-more-content--has-scrim
            = markdown_field(@project, :description)
          .js-read-more-trigger.gl-hidden.gl-w-full.gl-h-8.gl-absolute.gl-bottom-0.gl-z-2.gl-bg-default
            = render Pajamas::ButtonComponent.new(variant: :link, button_options: { 'aria-label': _("Expand project information") }) do
              = sprite_icon('chevron-down', size: 14)
              = _("Read more")

    -# Topics
    - if @project.topics.present?
      .gl-mb-5
        = render "shared/projects/topics", project: @project

    -# Programming languages
    - if can?(current_user, :read_code, @project) && @project.repository_languages.present?
      .gl-mb-2{ class: [('!gl-mb-4' if @project.badges.present?), ('gl-mt-3' if !@project.description.present?)] }
        = repository_languages_bar(@project.repository_languages)

    -# Badges
    - if @project.badges.present?
      .project-badges.gl-mb-2.gl-flex.gl-flex-wrap.gl-gap-2{ data: { testid: 'project-badges-content' } }
        - @project.badges.each do |badge|
          - badge_link_url = badge.rendered_link_url(@project)
          %a.gl-leading-1{ href: badge_link_url,
            target: '_blank',
            rel: 'noopener noreferrer',
            data: { testid: 'badge-image-link', qa_link_url: badge_link_url } }>
            %img.project-badge{ src: badge.rendered_image_url(@project),
              'aria-hidden': true,
              alt: 'Project badge' }>

  -# Invite members
  - if @project.empty_repo? && can?(current_user, :invite_member, @project)
    .project-page-sidebar-block.gl-py-4.gl-border-b.gl-border-b-subtle
      = render "invite_members_empty_project"

  -# Buttons
  - if can?(current_user, :read_code, @project) && !@project.empty_repo? && anchor_buttons.any?
    .project-page-sidebar-block.gl-py-4.gl-border-b.gl-border-b-subtle
      %nav.project-stats
        = render 'stat_anchor_list', anchors: anchor_buttons

  -# Buttons
  - if can?(current_user, :read_code, @project) && has_project_shortcut_buttons && (@project.empty_repo? ? statistics_empty_buttons.any? : statistics_buttons.any?)
    .project-page-sidebar-block.gl-py-4.gl-border-b.gl-border-b-subtle
      .project-buttons.gl-mb-2.js-show-on-project-root{ data: { testid: 'project-buttons' } }
        - if @project.empty_repo?
          = render 'stat_anchor_list', anchors: statistics_empty_buttons, project_buttons: true
        - else
          = render 'stat_anchor_list', anchors: statistics_buttons, project_buttons: true

  -# Compliance frameworks
  = render_if_exists 'compliance_management/compliance_framework/compliance_frameworks_info', project: @project

  -# Project created
  .project-page-sidebar-block.gl-py-4
    %p.gl-font-bold.gl-text-strong.gl-m-0.gl-mb-1= s_('ProjectPage|Created on')
    %span= l(@project.created_at.to_date, format: :long)
